/*
 Navicat Premium Dump SQL

 Source Server         : postgresql
 Source Server Type    : PostgreSQL
 Source Server Version : 170004 (170004)
 Source Host           : localhost:5432
 Source Catalog        : pig
 Source Schema         : pig_config

 Target Server Type    : PostgreSQL
 Target Server Version : 170004 (170004)
 File Encoding         : 65001

 Date: 03/07/2025 15:37:00
*/


-- ----------------------------
-- Sequence structure for config_info_beta_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "pig_config"."config_info_beta_id_seq";
CREATE SEQUENCE "pig_config"."config_info_beta_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 2147483647
START 1
CACHE 1;
ALTER SEQUENCE "pig_config"."config_info_beta_id_seq" OWNER TO "postgres";

-- ----------------------------
-- Sequence structure for config_info_gray_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "pig_config"."config_info_gray_id_seq";
CREATE SEQUENCE "pig_config"."config_info_gray_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 2147483647
START 1
CACHE 1;
ALTER SEQUENCE "pig_config"."config_info_gray_id_seq" OWNER TO "postgres";

-- ----------------------------
-- Sequence structure for config_info_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "pig_config"."config_info_id_seq";
CREATE SEQUENCE "pig_config"."config_info_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 2147483647
START 1
CACHE 1;
ALTER SEQUENCE "pig_config"."config_info_id_seq" OWNER TO "postgres";

-- ----------------------------
-- Sequence structure for config_info_tag_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "pig_config"."config_info_tag_id_seq";
CREATE SEQUENCE "pig_config"."config_info_tag_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 2147483647
START 1
CACHE 1;
ALTER SEQUENCE "pig_config"."config_info_tag_id_seq" OWNER TO "postgres";

-- ----------------------------
-- Sequence structure for config_tags_relation_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "pig_config"."config_tags_relation_id_seq";
CREATE SEQUENCE "pig_config"."config_tags_relation_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 2147483647
START 1
CACHE 1;
ALTER SEQUENCE "pig_config"."config_tags_relation_id_seq" OWNER TO "postgres";

-- ----------------------------
-- Sequence structure for config_tags_relation_nid_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "pig_config"."config_tags_relation_nid_seq";
CREATE SEQUENCE "pig_config"."config_tags_relation_nid_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
ALTER SEQUENCE "pig_config"."config_tags_relation_nid_seq" OWNER TO "postgres";

-- ----------------------------
-- Sequence structure for group_capacity_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "pig_config"."group_capacity_id_seq";
CREATE SEQUENCE "pig_config"."group_capacity_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 2147483647
START 1
CACHE 1;
ALTER SEQUENCE "pig_config"."group_capacity_id_seq" OWNER TO "postgres";

-- ----------------------------
-- Sequence structure for his_config_info_nid_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "pig_config"."his_config_info_nid_seq";
CREATE SEQUENCE "pig_config"."his_config_info_nid_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 2147483647
START 1
CACHE 1;
ALTER SEQUENCE "pig_config"."his_config_info_nid_seq" OWNER TO "postgres";

-- ----------------------------
-- Sequence structure for tenant_capacity_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "pig_config"."tenant_capacity_id_seq";
CREATE SEQUENCE "pig_config"."tenant_capacity_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 2147483647
START 1
CACHE 1;
ALTER SEQUENCE "pig_config"."tenant_capacity_id_seq" OWNER TO "postgres";

-- ----------------------------
-- Sequence structure for tenant_info_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "pig_config"."tenant_info_id_seq";
CREATE SEQUENCE "pig_config"."tenant_info_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 2147483647
START 1
CACHE 1;
ALTER SEQUENCE "pig_config"."tenant_info_id_seq" OWNER TO "postgres";

-- ----------------------------
-- Table structure for config_info
-- ----------------------------
DROP TABLE IF EXISTS "pig_config"."config_info";
CREATE TABLE "pig_config"."config_info" (
  "id" int4 NOT NULL DEFAULT nextval('"pig_config".config_info_id_seq'::regclass),
  "data_id" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "group_id" varchar(255) COLLATE "pg_catalog"."default",
  "content" text COLLATE "pg_catalog"."default" NOT NULL,
  "md5" varchar(32) COLLATE "pg_catalog"."default",
  "gmt_create" timestamp(6) NOT NULL,
  "gmt_modified" timestamp(6) NOT NULL,
  "src_user" text COLLATE "pg_catalog"."default",
  "src_ip" varchar(20) COLLATE "pg_catalog"."default",
  "app_name" varchar(128) COLLATE "pg_catalog"."default",
  "tenant_id" varchar(128) COLLATE "pg_catalog"."default",
  "c_desc" varchar(256) COLLATE "pg_catalog"."default",
  "c_use" varchar(64) COLLATE "pg_catalog"."default",
  "effect" varchar(64) COLLATE "pg_catalog"."default",
  "type" varchar(64) COLLATE "pg_catalog"."default",
  "c_schema" text COLLATE "pg_catalog"."default",
  "encrypted_data_key" text COLLATE "pg_catalog"."default" NOT NULL
)
;
ALTER TABLE "pig_config"."config_info" OWNER TO "postgres";
COMMENT ON COLUMN "pig_config"."config_info"."id" IS 'id';
COMMENT ON COLUMN "pig_config"."config_info"."data_id" IS 'data_id';
COMMENT ON COLUMN "pig_config"."config_info"."content" IS 'content';
COMMENT ON COLUMN "pig_config"."config_info"."md5" IS 'md5';
COMMENT ON COLUMN "pig_config"."config_info"."gmt_create" IS '创建时间';
COMMENT ON COLUMN "pig_config"."config_info"."gmt_modified" IS '修改时间';
COMMENT ON COLUMN "pig_config"."config_info"."src_user" IS 'source user';
COMMENT ON COLUMN "pig_config"."config_info"."src_ip" IS 'source ip';
COMMENT ON COLUMN "pig_config"."config_info"."tenant_id" IS '租户字段';
COMMENT ON COLUMN "pig_config"."config_info"."encrypted_data_key" IS '秘钥';
COMMENT ON TABLE "pig_config"."config_info" IS 'config_info';

-- ----------------------------
-- Records of config_info
-- ----------------------------
BEGIN;
INSERT INTO "pig_config"."config_info" ("id", "data_id", "group_id", "content", "md5", "gmt_create", "gmt_modified", "src_user", "src_ip", "app_name", "tenant_id", "c_desc", "c_use", "effect", "type", "c_schema", "encrypted_data_key") VALUES (1, 'application-dev.yml', 'DEFAULT_GROUP', '# 配置文件加密根密码
jasypt:
  encryptor:
    password: pig
    algorithm: PBEWithMD5AndDES
    iv-generator-classname: org.jasypt.iv.NoIvGenerator
    
# Spring 相关
spring:
  cache:
    type: redis
  data:
    redis:
      host: ${REDIS_HOST:127.0.0.1}
  cloud:
    sentinel:
      eager: true
      transport:
        dashboard: pig-sentinel:5003
    openfeign:
      sentinel:
        enabled: true
      okhttp:
        enabled: true
      httpclient:
        enabled: false
      compression:
        request:
          enabled: true
        response:
          enabled: true

# 暴露监控端点
management:
  endpoints:
    web:
      exposure:
        include: "*"  
  endpoint:
    health:
      show-details: ALWAYS

# mybaits-plus配置
mybatis-plus:
  mapper-locations: classpath:/mapper/*Mapper.xml
  global-config:
    banner: false
    db-config:
      id-type: auto
      table-underline: true
      logic-delete-value: 1
      logic-not-delete-value: 0
  type-handlers-package: com.pig4cloud.pig.common.mybatis.handler
  configuration:
    map-underscore-to-camel-case: true
    shrink-whitespaces-in-sql: true

# swagger 配置
swagger:
  enabled: true
  title: Pig Swagger API
  gateway: http://${GATEWAY_HOST:pig-gateway}:${GATEWAY-PORT:9999}
  token-url: ${swagger.gateway}/auth/oauth2/token
  scope: server
  services:
    pig-upms-biz: admin
    pig-codegen: gen', '83cbbb61027b81b533bfde8b789e91e0', '2025-01-30 16:50:04', '2025-01-30 16:50:04', 'nacos', '127.0.0.1', '', '', NULL, NULL, NULL, 'yaml', NULL, '');
INSERT INTO "pig_config"."config_info" ("id", "data_id", "group_id", "content", "md5", "gmt_create", "gmt_modified", "src_user", "src_ip", "app_name", "tenant_id", "c_desc", "c_use", "effect", "type", "c_schema", "encrypted_data_key") VALUES (2, 'pig-auth-dev.yml', 'DEFAULT_GROUP', '# 数据源
spring:
  freemarker:
    allow-request-override: false
    allow-session-override: false
    cache: true
    charset: UTF-8
    check-template-location: true
    content-type: text/html
    enabled: true
    request-context-attribute: request
    expose-request-attributes: false
    expose-session-attributes: false
    expose-spring-macro-helpers: true
    prefer-file-system-access: true
    suffix: .ftl
    template-loader-path: classpath:/templates/


security:
  encode-key: ''thanks,pig4cloud''
  ignore-clients:
    - test
    - client
    - open
    - app', 'b4a660ece61e8180b4940a0770eddfee', '2025-01-30 16:50:04', '2025-01-30 16:50:04', 'nacos', '127.0.0.1', '', '', NULL, NULL, NULL, 'yaml', NULL, '');
INSERT INTO "pig_config"."config_info" ("id", "data_id", "group_id", "content", "md5", "gmt_create", "gmt_modified", "src_user", "src_ip", "app_name", "tenant_id", "c_desc", "c_use", "effect", "type", "c_schema", "encrypted_data_key") VALUES (4, 'pig-gateway-dev.yml', 'DEFAULT_GROUP', 'spring:
  cloud:
    gateway:
      locator:
        enabled: true
      routes:
        # 认证中心
        - id: pig-auth
          uri: lb://pig-auth
          predicates:
            - Path=/auth/**
        #UPMS 模块
        - id: pig-upms-biz
          uri: lb://pig-upms-biz
          predicates:
            - Path=/admin/**
          filters:
            # 限流配置
            - name: RequestRateLimiter
              args:
                key-resolver: ''#{@remoteAddrKeyResolver}''
                redis-rate-limiter.replenishRate: 100
                redis-rate-limiter.burstCapacity: 200
        # 代码生成模块
        - id: pig-codegen
          uri: lb://pig-codegen
          predicates:
            - Path=/gen/**
        # 代码生成模块
        - id: pig-quartz
          uri: lb://pig-quartz
          predicates:
            - Path=/job/**
        # 固定路由转发配置 无修改
        - id: openapi
          uri: lb://pig-gateway
          predicates:
            - Path=/v3/api-docs/**
          filters:
            - RewritePath=/v3/api-docs/(?<path>.*), /$\{path}/$\{path}/v3/api-docs', '7940b3e89a9489e0844af6b1dc91d65b', '2025-01-30 16:50:04', '2025-01-30 16:50:04', 'nacos', '127.0.0.1', '', '', NULL, NULL, NULL, 'yaml', NULL, '');
INSERT INTO "pig_config"."config_info" ("id", "data_id", "group_id", "content", "md5", "gmt_create", "gmt_modified", "src_user", "src_ip", "app_name", "tenant_id", "c_desc", "c_use", "effect", "type", "c_schema", "encrypted_data_key") VALUES (5, 'pig-monitor-dev.yml', 'DEFAULT_GROUP', 'spring:
  autoconfigure:
    exclude: com.pig4cloud.pig.common.core.config.JacksonConfiguration
  # 安全配置
  security:
    user:
      name: ENC(8Hk2ILNJM8UTOuW/Xi75qg==)     # pig
      password: ENC(o6cuPFfUevmTbkmBnE67Ow====) # pig
', '650bdfa15f60f3faa84dfe6e6878b8cf', '2025-01-30 16:50:04', '2025-01-30 16:50:04', 'nacos', '127.0.0.1', '', '', NULL, NULL, NULL, 'yaml', NULL, '');
INSERT INTO "pig_config"."config_info" ("id", "data_id", "group_id", "content", "md5", "gmt_create", "gmt_modified", "src_user", "src_ip", "app_name", "tenant_id", "c_desc", "c_use", "effect", "type", "c_schema", "encrypted_data_key") VALUES (6, 'pig-upms-biz-dev.yml', 'DEFAULT_GROUP', '# 数据源
spring:
  datasource:
    #type: com.zaxxer.hikari.HikariDataSource
    #driver-class-name: com.mysql.cj.jdbc.Driver
    #username: root
    #password: root
    #url: jdbc:mysql://${MYSQL_HOST:127.0.0.1}:${MYSQL_PORT:3306}/${MYSQL_DB:pig}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
    type: com.zaxxer.hikari.HikariDataSource
    driver-class-name: org.postgresql.Driver
    username: postgres
    password: postgres
    url: jdbc:postgresql://127.0.0.1:5432/pig?currentSchema=pig&useUnicode=true&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true

# 文件上传相关 支持阿里云、华为云、腾讯、minio
file:
  bucketName: s3demo
  local:
    enable: true
    base-path: /Users/lengleng/Downloads/img', 'c8bc67877fa0e0723bfb6738602163ba', '2025-01-30 16:50:04', '2025-05-29 13:20:43', 'nacos_namespace_migrate', '127.0.0.1', '', '', '', NULL, NULL, 'yaml', NULL, '');
INSERT INTO "pig_config"."config_info" ("id", "data_id", "group_id", "content", "md5", "gmt_create", "gmt_modified", "src_user", "src_ip", "app_name", "tenant_id", "c_desc", "c_use", "effect", "type", "c_schema", "encrypted_data_key") VALUES (7, 'pig-quartz-dev.yml', 'DEFAULT_GROUP', 'spring:
  datasource:
    #type: com.zaxxer.hikari.HikariDataSource
    #driver-class-name: com.mysql.cj.jdbc.Driver
    #username: root
    #password: root
    #url: jdbc:mysql://${MYSQL_HOST:127.0.0.1}:${MYSQL_PORT:3306}/${MYSQL_DB:pig}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
    type: com.zaxxer.hikari.HikariDataSource
    driver-class-name: org.postgresql.Driver
    username: postgres
    password: postgres
    url: jdbc:postgresql://127.0.0.1:5432/pig?currentSchema=pig&useUnicode=true&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true",945b67b4bbdcde8668d3f176ac33623d,2025-01-30 16:50:04,2025-05-29 13:21:03,nacos_namespace_migrate,127.0.0.1,"","","",,,yaml,,""
', '945b67b4bbdcde8668d3f176ac33623d', '2025-01-30 16:50:04', '2025-05-29 13:21:03', 'nacos_namespace_migrate', '127.0.0.1', '', '', '', NULL, NULL, 'yaml', NULL, '');
INSERT INTO "pig_config"."config_info" ("id", "data_id", "group_id", "content", "md5", "gmt_create", "gmt_modified", "src_user", "src_ip", "app_name", "tenant_id", "c_desc", "c_use", "effect", "type", "c_schema", "encrypted_data_key") VALUES (3, 'pig-codegen-dev.yml', 'DEFAULT_GROUP', '# 数据源配置
spring:
  datasource:
    #type: com.zaxxer.hikari.HikariDataSource
    #driver-class-name: com.mysql.cj.jdbc.Driver
    #username: root
    #password: root
    #url: jdbc:mysql://${MYSQL_HOST:127.0.0.1}:${MYSQL_PORT:3306}/${MYSQL_DB:pig}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
    type: com.zaxxer.hikari.HikariDataSource
    driver-class-name: org.postgresql.Driver
    username: postgres
    password: postgres
    url: jdbc:postgresql://127.0.0.1:5432/pig?currentSchema=pig&useUnicode=true&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
  resources:
    static-locations: classpath:/static/,classpath:/views/
', 'cfb6c90d4f5c61330fae96254e86abc4', '2025-01-30 16:50:04', '2025-05-29 13:20:15', 'nacos_namespace_migrate', '127.0.0.1', '', '', '', NULL, NULL, 'yaml', NULL, '');
INSERT INTO "pig_config"."config_info" ("id", "data_id", "group_id", "content", "md5", "gmt_create", "gmt_modified", "src_user", "src_ip", "app_name", "tenant_id", "c_desc", "c_use", "effect", "type", "c_schema", "encrypted_data_key") VALUES (8, 'application-dev.yml', 'DEFAULT_GROUP', '# 配置文件加密根密码
jasypt:
  encryptor:
    password: pig
    algorithm: PBEWithMD5AndDES
    iv-generator-classname: org.jasypt.iv.NoIvGenerator

# Spring 相关
spring:
  cache:
    type: redis
  data:
    redis:
      host: ${REDIS_HOST:127.0.0.1}
  cloud:
    sentinel:
      eager: true
      transport:
        dashboard: pig-sentinel:5003
    openfeign:
      sentinel:
        enabled: true
      okhttp:
        enabled: true
      httpclient:
        enabled: false
      compression:
        request:
          enabled: true
        response:
          enabled: true

# 暴露监控端点
management:
  endpoints:
    web:
      exposure:
        include: "*"
  endpoint:
    health:
      show-details: ALWAYS

# mybaits-plus配置
mybatis-plus:
  mapper-locations: classpath:/mapper/*Mapper.xml
  global-config:
    banner: false
    db-config:
      id-type: auto
      table-underline: true
      logic-delete-value: 1
      logic-not-delete-value: 0
  type-handlers-package: com.pig4cloud.pig.common.mybatis.handler
  configuration:
    map-underscore-to-camel-case: true
    shrink-whitespaces-in-sql: true

# swagger 配置
swagger:
  enabled: true
  title: Pig Swagger API
  gateway: http://${GATEWAY_HOST:pig-gateway}:${GATEWAY-PORT:9999}
  token-url: ${swagger.gateway}/auth/oauth2/token
  scope: server
  services:
    pig-upms-biz: admin
    pig-codegen: gen', '83cbbb61027b81b533bfde8b789e91e0', '2025-05-29 11:15:35', '2025-05-29 11:15:35', 'nacos_namespace_migrate', '127.0.0.1', '', 'public', NULL, NULL, NULL, 'yaml', NULL, '');
INSERT INTO "pig_config"."config_info" ("id", "data_id", "group_id", "content", "md5", "gmt_create", "gmt_modified", "src_user", "src_ip", "app_name", "tenant_id", "c_desc", "c_use", "effect", "type", "c_schema", "encrypted_data_key") VALUES (9, 'pig-auth-dev.yml', 'DEFAULT_GROUP', '# 数据源
spring:
  freemarker:
    allow-request-override: false
    allow-session-override: false
    cache: true
    charset: UTF-8
    check-template-location: true
    content-type: text/html
    enabled: true
    request-context-attribute: request
    expose-request-attributes: false
    expose-session-attributes: false
    expose-spring-macro-helpers: true
    prefer-file-system-access: true
    suffix: .ftl
    template-loader-path: classpath:/templates/


security:
  encode-key: ''thanks,pig4cloud''
  ignore-clients:
    - test
    - client
    - open
    - app', 'b4a660ece61e8180b4940a0770eddfee', '2025-05-29 11:15:35', '2025-05-29 11:15:35', 'nacos_namespace_migrate', '127.0.0.1', '', 'public', NULL, NULL, NULL, 'yaml', NULL, '');
INSERT INTO "pig_config"."config_info" ("id", "data_id", "group_id", "content", "md5", "gmt_create", "gmt_modified", "src_user", "src_ip", "app_name", "tenant_id", "c_desc", "c_use", "effect", "type", "c_schema", "encrypted_data_key") VALUES (11, 'pig-gateway-dev.yml', 'DEFAULT_GROUP', 'spring:
  cloud:
    gateway:
      locator:
        enabled: true
      routes:
        # 认证中心
        - id: pig-auth
          uri: lb://pig-auth
          predicates:
            - Path=/auth/**
        #UPMS 模块
        - id: pig-upms-biz
          uri: lb://pig-upms-biz
          predicates:
            - Path=/admin/**
          filters:
            # 限流配置
            - name: RequestRateLimiter
              args:
                key-resolver: ''#{@remoteAddrKeyResolver}''
                redis-rate-limiter.replenishRate: 100
                redis-rate-limiter.burstCapacity: 200
        # 代码生成模块
        - id: pig-codegen
          uri: lb://pig-codegen
          predicates:
            - Path=/gen/**
        # 代码生成模块
        - id: pig-quartz
          uri: lb://pig-quartz
          predicates:
            - Path=/job/**
        # 固定路由转发配置 无修改
        - id: openapi
          uri: lb://pig-gateway
          predicates:
            - Path=/v3/api-docs/**
          filters:
            - RewritePath=/v3/api-docs/(?<path>.*), /$\{path}/$\{path}/v3/api-docs', '7940b3e89a9489e0844af6b1dc91d65b', '2025-05-29 11:15:35', '2025-05-29 11:15:35', 'nacos_namespace_migrate', '127.0.0.1', '', 'public', NULL, NULL, NULL, 'yaml', NULL, '');
INSERT INTO "pig_config"."config_info" ("id", "data_id", "group_id", "content", "md5", "gmt_create", "gmt_modified", "src_user", "src_ip", "app_name", "tenant_id", "c_desc", "c_use", "effect", "type", "c_schema", "encrypted_data_key") VALUES (12, 'pig-monitor-dev.yml', 'DEFAULT_GROUP', 'spring:
  autoconfigure:
    exclude: com.pig4cloud.pig.common.core.config.JacksonConfiguration
  # 安全配置
  security:
    user:
      name: ENC(8Hk2ILNJM8UTOuW/Xi75qg==)     # pig
      password: ENC(o6cuPFfUevmTbkmBnE67Ow====) # pig
', '650bdfa15f60f3faa84dfe6e6878b8cf', '2025-05-29 11:15:35', '2025-05-29 11:15:35', 'nacos_namespace_migrate', '127.0.0.1', '', 'public', NULL, NULL, NULL, 'yaml', NULL, '');
INSERT INTO "pig_config"."config_info" ("id", "data_id", "group_id", "content", "md5", "gmt_create", "gmt_modified", "src_user", "src_ip", "app_name", "tenant_id", "c_desc", "c_use", "effect", "type", "c_schema", "encrypted_data_key") VALUES (10, 'pig-codegen-dev.yml', 'DEFAULT_GROUP', '# 数据源配置
spring:
  datasource:
    #type: com.zaxxer.hikari.HikariDataSource
    #driver-class-name: com.mysql.cj.jdbc.Driver
    #username: root
    #password: root
    #url: jdbc:mysql://${MYSQL_HOST:127.0.0.1}:${MYSQL_PORT:3306}/${MYSQL_DB:pig}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
    type: com.zaxxer.hikari.HikariDataSource
    driver-class-name: org.postgresql.Driver
    username: postgres
    password: postgres
    url: jdbc:postgresql://127.0.0.1:5432/pig?currentSchema=pig&useUnicode=true&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
  resources:
    static-locations: classpath:/static/,classpath:/views/
', 'cfb6c90d4f5c61330fae96254e86abc4', '2025-05-29 11:15:35', '2025-05-29 13:20:15', 'nacos', '127.0.0.1', '', 'public', '', NULL, NULL, 'yaml', NULL, '');
INSERT INTO "pig_config"."config_info" ("id", "data_id", "group_id", "content", "md5", "gmt_create", "gmt_modified", "src_user", "src_ip", "app_name", "tenant_id", "c_desc", "c_use", "effect", "type", "c_schema", "encrypted_data_key") VALUES (13, 'pig-upms-biz-dev.yml', 'DEFAULT_GROUP', '# 数据源
spring:
  datasource:
    #type: com.zaxxer.hikari.HikariDataSource
    #driver-class-name: com.mysql.cj.jdbc.Driver
    #username: root
    #password: root
    #url: jdbc:mysql://${MYSQL_HOST:127.0.0.1}:${MYSQL_PORT:3306}/${MYSQL_DB:pig}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
    type: com.zaxxer.hikari.HikariDataSource
    driver-class-name: org.postgresql.Driver
    username: postgres
    password: postgres
    url: jdbc:postgresql://127.0.0.1:5432/pig?currentSchema=pig&useUnicode=true&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true

# 文件上传相关 支持阿里云、华为云、腾讯、minio
file:
  bucketName: s3demo
  local:
    enable: true
    base-path: /Users/lengleng/Downloads/img', 'c8bc67877fa0e0723bfb6738602163ba', '2025-05-29 11:15:35', '2025-05-29 13:20:43', 'nacos', '127.0.0.1', '', 'public', '', NULL, NULL, 'yaml', NULL, '');
INSERT INTO "pig_config"."config_info" ("id", "data_id", "group_id", "content", "md5", "gmt_create", "gmt_modified", "src_user", "src_ip", "app_name", "tenant_id", "c_desc", "c_use", "effect", "type", "c_schema", "encrypted_data_key") VALUES (14, 'pig-quartz-dev.yml', 'DEFAULT_GROUP', 'spring:
  datasource:
    #type: com.zaxxer.hikari.HikariDataSource
    #driver-class-name: com.mysql.cj.jdbc.Driver
    #username: root
    #password: root
    #url: jdbc:mysql://${MYSQL_HOST:127.0.0.1}:${MYSQL_PORT:3306}/${MYSQL_DB:pig}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
    type: com.zaxxer.hikari.HikariDataSource
    driver-class-name: org.postgresql.Driver
    username: postgres
    password: postgres
    url: jdbc:postgresql://127.0.0.1:5432/pig?currentSchema=pig&useUnicode=true&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
', '945b67b4bbdcde8668d3f176ac33623d', '2025-05-29 11:15:35', '2025-05-29 13:21:03', 'nacos', '127.0.0.1', '', 'public', '', NULL, NULL, 'yaml', NULL, '');
COMMIT;

-- ----------------------------
-- Table structure for config_info_beta
-- ----------------------------
DROP TABLE IF EXISTS "pig_config"."config_info_beta";
CREATE TABLE "pig_config"."config_info_beta" (
  "id" int4 NOT NULL DEFAULT nextval('"pig_config".config_info_beta_id_seq'::regclass),
  "data_id" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "group_id" varchar(128) COLLATE "pg_catalog"."default" NOT NULL,
  "app_name" varchar(128) COLLATE "pg_catalog"."default",
  "content" text COLLATE "pg_catalog"."default" NOT NULL,
  "beta_ips" varchar(1024) COLLATE "pg_catalog"."default",
  "md5" varchar(32) COLLATE "pg_catalog"."default",
  "gmt_create" timestamp(6) NOT NULL,
  "gmt_modified" timestamp(6) NOT NULL,
  "src_user" text COLLATE "pg_catalog"."default",
  "src_ip" varchar(20) COLLATE "pg_catalog"."default",
  "tenant_id" varchar(128) COLLATE "pg_catalog"."default",
  "encrypted_data_key" text COLLATE "pg_catalog"."default" NOT NULL
)
;
ALTER TABLE "pig_config"."config_info_beta" OWNER TO "postgres";
COMMENT ON COLUMN "pig_config"."config_info_beta"."id" IS 'id';
COMMENT ON COLUMN "pig_config"."config_info_beta"."data_id" IS 'data_id';
COMMENT ON COLUMN "pig_config"."config_info_beta"."group_id" IS 'group_id';
COMMENT ON COLUMN "pig_config"."config_info_beta"."app_name" IS 'app_name';
COMMENT ON COLUMN "pig_config"."config_info_beta"."content" IS 'content';
COMMENT ON COLUMN "pig_config"."config_info_beta"."beta_ips" IS 'betaIps';
COMMENT ON COLUMN "pig_config"."config_info_beta"."md5" IS 'md5';
COMMENT ON COLUMN "pig_config"."config_info_beta"."gmt_create" IS '创建时间';
COMMENT ON COLUMN "pig_config"."config_info_beta"."gmt_modified" IS '修改时间';
COMMENT ON COLUMN "pig_config"."config_info_beta"."src_user" IS 'source user';
COMMENT ON COLUMN "pig_config"."config_info_beta"."src_ip" IS 'source ip';
COMMENT ON COLUMN "pig_config"."config_info_beta"."tenant_id" IS '租户字段';
COMMENT ON COLUMN "pig_config"."config_info_beta"."encrypted_data_key" IS '秘钥';
COMMENT ON TABLE "pig_config"."config_info_beta" IS 'config_info_beta';

-- ----------------------------
-- Records of config_info_beta
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for config_info_gray
-- ----------------------------
DROP TABLE IF EXISTS "pig_config"."config_info_gray";
CREATE TABLE "pig_config"."config_info_gray" (
  "id" int4 NOT NULL DEFAULT nextval('"pig_config".config_info_gray_id_seq'::regclass),
  "data_id" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "group_id" varchar(128) COLLATE "pg_catalog"."default" NOT NULL,
  "content" text COLLATE "pg_catalog"."default" NOT NULL,
  "md5" varchar(32) COLLATE "pg_catalog"."default",
  "src_user" text COLLATE "pg_catalog"."default",
  "src_ip" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "gmt_create" timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
  "gmt_modified" timestamp(6) NOT NULL,
  "app_name" varchar(128) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
  "tenant_id" varchar(128) COLLATE "pg_catalog"."default" DEFAULT ''::character varying,
  "gray_name" varchar(128) COLLATE "pg_catalog"."default" NOT NULL,
  "gray_rule" text COLLATE "pg_catalog"."default" NOT NULL,
  "encrypted_data_key" varchar(256) COLLATE "pg_catalog"."default" NOT NULL
)
;
ALTER TABLE "pig_config"."config_info_gray" OWNER TO "postgres";
COMMENT ON COLUMN "pig_config"."config_info_gray"."id" IS '自增ID';
COMMENT ON COLUMN "pig_config"."config_info_gray"."data_id" IS 'data_id';
COMMENT ON COLUMN "pig_config"."config_info_gray"."group_id" IS 'group_id';
COMMENT ON COLUMN "pig_config"."config_info_gray"."content" IS 'content';
COMMENT ON COLUMN "pig_config"."config_info_gray"."md5" IS 'md5';
COMMENT ON COLUMN "pig_config"."config_info_gray"."src_user" IS 'src_user';
COMMENT ON COLUMN "pig_config"."config_info_gray"."src_ip" IS 'src_ip';
COMMENT ON COLUMN "pig_config"."config_info_gray"."gmt_create" IS 'gmt_create';
COMMENT ON COLUMN "pig_config"."config_info_gray"."gmt_modified" IS 'gmt_modified';
COMMENT ON COLUMN "pig_config"."config_info_gray"."app_name" IS 'app_name';
COMMENT ON COLUMN "pig_config"."config_info_gray"."tenant_id" IS 'tenant_id';
COMMENT ON COLUMN "pig_config"."config_info_gray"."gray_name" IS 'gray_name';
COMMENT ON COLUMN "pig_config"."config_info_gray"."gray_rule" IS 'gray_rule';
COMMENT ON COLUMN "pig_config"."config_info_gray"."encrypted_data_key" IS 'encrypted_data_key';

-- ----------------------------
-- Records of config_info_gray
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for config_info_tag
-- ----------------------------
DROP TABLE IF EXISTS "pig_config"."config_info_tag";
CREATE TABLE "pig_config"."config_info_tag" (
  "id" int4 NOT NULL DEFAULT nextval('"pig_config".config_info_tag_id_seq'::regclass),
  "data_id" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "group_id" varchar(128) COLLATE "pg_catalog"."default" NOT NULL,
  "tenant_id" varchar(128) COLLATE "pg_catalog"."default",
  "tag_id" varchar(128) COLLATE "pg_catalog"."default" NOT NULL,
  "app_name" varchar(128) COLLATE "pg_catalog"."default",
  "content" text COLLATE "pg_catalog"."default" NOT NULL,
  "md5" varchar(32) COLLATE "pg_catalog"."default",
  "gmt_create" timestamp(6) NOT NULL,
  "gmt_modified" timestamp(6) NOT NULL,
  "src_user" text COLLATE "pg_catalog"."default",
  "src_ip" varchar(20) COLLATE "pg_catalog"."default"
)
;
ALTER TABLE "pig_config"."config_info_tag" OWNER TO "postgres";
COMMENT ON COLUMN "pig_config"."config_info_tag"."id" IS 'id';
COMMENT ON COLUMN "pig_config"."config_info_tag"."data_id" IS 'data_id';
COMMENT ON COLUMN "pig_config"."config_info_tag"."group_id" IS 'group_id';
COMMENT ON COLUMN "pig_config"."config_info_tag"."tenant_id" IS 'tenant_id';
COMMENT ON COLUMN "pig_config"."config_info_tag"."tag_id" IS 'tag_id';
COMMENT ON COLUMN "pig_config"."config_info_tag"."app_name" IS 'app_name';
COMMENT ON COLUMN "pig_config"."config_info_tag"."content" IS 'content';
COMMENT ON COLUMN "pig_config"."config_info_tag"."md5" IS 'md5';
COMMENT ON COLUMN "pig_config"."config_info_tag"."gmt_create" IS '创建时间';
COMMENT ON COLUMN "pig_config"."config_info_tag"."gmt_modified" IS '修改时间';
COMMENT ON COLUMN "pig_config"."config_info_tag"."src_user" IS 'source user';
COMMENT ON COLUMN "pig_config"."config_info_tag"."src_ip" IS 'source ip';
COMMENT ON TABLE "pig_config"."config_info_tag" IS 'config_info_tag';

-- ----------------------------
-- Records of config_info_tag
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for config_tags_relation
-- ----------------------------
DROP TABLE IF EXISTS "pig_config"."config_tags_relation";
CREATE TABLE "pig_config"."config_tags_relation" (
  "id" int4 NOT NULL DEFAULT nextval('"pig_config".config_tags_relation_id_seq'::regclass),
  "tag_name" varchar(128) COLLATE "pg_catalog"."default" NOT NULL,
  "tag_type" varchar(64) COLLATE "pg_catalog"."default",
  "data_id" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "group_id" varchar(128) COLLATE "pg_catalog"."default" NOT NULL,
  "tenant_id" varchar(128) COLLATE "pg_catalog"."default",
  "nid" int8 NOT NULL DEFAULT nextval('"pig_config".config_tags_relation_nid_seq'::regclass)
)
;
ALTER TABLE "pig_config"."config_tags_relation" OWNER TO "postgres";
COMMENT ON COLUMN "pig_config"."config_tags_relation"."id" IS 'id';
COMMENT ON COLUMN "pig_config"."config_tags_relation"."tag_name" IS 'tag_name';
COMMENT ON COLUMN "pig_config"."config_tags_relation"."tag_type" IS 'tag_type';
COMMENT ON COLUMN "pig_config"."config_tags_relation"."data_id" IS 'data_id';
COMMENT ON COLUMN "pig_config"."config_tags_relation"."group_id" IS 'group_id';
COMMENT ON COLUMN "pig_config"."config_tags_relation"."tenant_id" IS 'tenant_id';
COMMENT ON TABLE "pig_config"."config_tags_relation" IS 'config_tag_relation';

-- ----------------------------
-- Records of config_tags_relation
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for group_capacity
-- ----------------------------
DROP TABLE IF EXISTS "pig_config"."group_capacity";
CREATE TABLE "pig_config"."group_capacity" (
  "id" int4 NOT NULL DEFAULT nextval('"pig_config".group_capacity_id_seq'::regclass),
  "group_id" varchar(128) COLLATE "pg_catalog"."default" NOT NULL,
  "quota" int4 NOT NULL,
  "usage" int4 NOT NULL,
  "max_size" int4 NOT NULL,
  "max_aggr_count" int4 NOT NULL,
  "max_aggr_size" int4 NOT NULL,
  "max_history_count" int4 NOT NULL,
  "gmt_create" timestamp(6) NOT NULL,
  "gmt_modified" timestamp(6) NOT NULL
)
;
ALTER TABLE "pig_config"."group_capacity" OWNER TO "postgres";
COMMENT ON COLUMN "pig_config"."group_capacity"."id" IS '主键ID';
COMMENT ON COLUMN "pig_config"."group_capacity"."group_id" IS 'Group ID，空字符表示整个集群';
COMMENT ON COLUMN "pig_config"."group_capacity"."quota" IS '配额，0表示使用默认值';
COMMENT ON COLUMN "pig_config"."group_capacity"."usage" IS '使用量';
COMMENT ON COLUMN "pig_config"."group_capacity"."max_size" IS '单个配置大小上限，单位为字节，0表示使用默认值';
COMMENT ON COLUMN "pig_config"."group_capacity"."max_aggr_count" IS '聚合子配置最大个数，，0表示使用默认值';
COMMENT ON COLUMN "pig_config"."group_capacity"."max_aggr_size" IS '单个聚合数据的子配置大小上限，单位为字节，0表示使用默认值';
COMMENT ON COLUMN "pig_config"."group_capacity"."max_history_count" IS '最大变更历史数量';
COMMENT ON COLUMN "pig_config"."group_capacity"."gmt_create" IS '创建时间';
COMMENT ON COLUMN "pig_config"."group_capacity"."gmt_modified" IS '修改时间';
COMMENT ON TABLE "pig_config"."group_capacity" IS '集群、各Group容量信息表';

-- ----------------------------
-- Records of group_capacity
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for his_config_info
-- ----------------------------
DROP TABLE IF EXISTS "pig_config"."his_config_info";
CREATE TABLE "pig_config"."his_config_info" (
  "id" int8 NOT NULL,
  "nid" int4 NOT NULL DEFAULT nextval('"pig_config".his_config_info_nid_seq'::regclass),
  "data_id" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
  "group_id" varchar(128) COLLATE "pg_catalog"."default" NOT NULL,
  "app_name" varchar(128) COLLATE "pg_catalog"."default",
  "content" text COLLATE "pg_catalog"."default" NOT NULL,
  "md5" varchar(32) COLLATE "pg_catalog"."default",
  "gmt_create" timestamp(6) NOT NULL DEFAULT '2010-05-05 00:00:00'::timestamp without time zone,
  "gmt_modified" timestamp(6) NOT NULL,
  "src_user" text COLLATE "pg_catalog"."default",
  "src_ip" varchar(20) COLLATE "pg_catalog"."default",
  "op_type" char(10) COLLATE "pg_catalog"."default",
  "tenant_id" varchar(128) COLLATE "pg_catalog"."default",
  "encrypted_data_key" text COLLATE "pg_catalog"."default" NOT NULL
)
;
ALTER TABLE "pig_config"."his_config_info" OWNER TO "postgres";
COMMENT ON COLUMN "pig_config"."his_config_info"."app_name" IS 'app_name';
COMMENT ON COLUMN "pig_config"."his_config_info"."tenant_id" IS '租户字段';
COMMENT ON COLUMN "pig_config"."his_config_info"."encrypted_data_key" IS '秘钥';
COMMENT ON TABLE "pig_config"."his_config_info" IS '多租户改造';

-- ----------------------------
-- Records of his_config_info
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for permissions
-- ----------------------------
DROP TABLE IF EXISTS "pig_config"."permissions";
CREATE TABLE "pig_config"."permissions" (
  "role" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "resource" varchar(512) COLLATE "pg_catalog"."default" NOT NULL,
  "action" varchar(8) COLLATE "pg_catalog"."default" NOT NULL
)
;
ALTER TABLE "pig_config"."permissions" OWNER TO "postgres";

-- ----------------------------
-- Records of permissions
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for roles
-- ----------------------------
DROP TABLE IF EXISTS "pig_config"."roles";
CREATE TABLE "pig_config"."roles" (
  "username" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "role" varchar(50) COLLATE "pg_catalog"."default" NOT NULL
)
;
ALTER TABLE "pig_config"."roles" OWNER TO "postgres";

-- ----------------------------
-- Records of roles
-- ----------------------------
BEGIN;
INSERT INTO "pig_config"."roles" ("username", "role") VALUES ('nacos', 'ROLE_ADMIN');
COMMIT;

-- ----------------------------
-- Table structure for tenant_capacity
-- ----------------------------
DROP TABLE IF EXISTS "pig_config"."tenant_capacity";
CREATE TABLE "pig_config"."tenant_capacity" (
  "id" int4 NOT NULL DEFAULT nextval('"pig_config".tenant_capacity_id_seq'::regclass),
  "tenant_id" varchar(128) COLLATE "pg_catalog"."default" NOT NULL,
  "quota" int4 NOT NULL,
  "usage" int4 NOT NULL,
  "max_size" int4 NOT NULL,
  "max_aggr_count" int4 NOT NULL,
  "max_aggr_size" int4 NOT NULL,
  "max_history_count" int4 NOT NULL,
  "gmt_create" timestamp(6) NOT NULL,
  "gmt_modified" timestamp(6) NOT NULL
)
;
ALTER TABLE "pig_config"."tenant_capacity" OWNER TO "postgres";
COMMENT ON COLUMN "pig_config"."tenant_capacity"."id" IS '主键ID';
COMMENT ON COLUMN "pig_config"."tenant_capacity"."tenant_id" IS 'Tenant ID';
COMMENT ON COLUMN "pig_config"."tenant_capacity"."quota" IS '配额，0表示使用默认值';
COMMENT ON COLUMN "pig_config"."tenant_capacity"."usage" IS '使用量';
COMMENT ON COLUMN "pig_config"."tenant_capacity"."max_size" IS '单个配置大小上限，单位为字节，0表示使用默认值';
COMMENT ON COLUMN "pig_config"."tenant_capacity"."max_aggr_count" IS '聚合子配置最大个数';
COMMENT ON COLUMN "pig_config"."tenant_capacity"."max_aggr_size" IS '单个聚合数据的子配置大小上限，单位为字节，0表示使用默认值';
COMMENT ON COLUMN "pig_config"."tenant_capacity"."max_history_count" IS '最大变更历史数量';
COMMENT ON COLUMN "pig_config"."tenant_capacity"."gmt_create" IS '创建时间';
COMMENT ON COLUMN "pig_config"."tenant_capacity"."gmt_modified" IS '修改时间';
COMMENT ON TABLE "pig_config"."tenant_capacity" IS '租户容量信息表';

-- ----------------------------
-- Records of tenant_capacity
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for tenant_info
-- ----------------------------
DROP TABLE IF EXISTS "pig_config"."tenant_info";
CREATE TABLE "pig_config"."tenant_info" (
  "id" int4 NOT NULL DEFAULT nextval('"pig_config".tenant_info_id_seq'::regclass),
  "kp" varchar(128) COLLATE "pg_catalog"."default" NOT NULL,
  "tenant_id" varchar(128) COLLATE "pg_catalog"."default",
  "tenant_name" varchar(128) COLLATE "pg_catalog"."default",
  "tenant_desc" varchar(256) COLLATE "pg_catalog"."default",
  "create_source" varchar(32) COLLATE "pg_catalog"."default",
  "gmt_create" int8 NOT NULL,
  "gmt_modified" int8 NOT NULL
)
;
ALTER TABLE "pig_config"."tenant_info" OWNER TO "postgres";
COMMENT ON COLUMN "pig_config"."tenant_info"."id" IS 'id';
COMMENT ON COLUMN "pig_config"."tenant_info"."kp" IS 'kp';
COMMENT ON COLUMN "pig_config"."tenant_info"."tenant_id" IS 'tenant_id';
COMMENT ON COLUMN "pig_config"."tenant_info"."tenant_name" IS 'tenant_name';
COMMENT ON COLUMN "pig_config"."tenant_info"."tenant_desc" IS 'tenant_desc';
COMMENT ON COLUMN "pig_config"."tenant_info"."create_source" IS 'create_source';
COMMENT ON COLUMN "pig_config"."tenant_info"."gmt_create" IS '创建时间';
COMMENT ON COLUMN "pig_config"."tenant_info"."gmt_modified" IS '修改时间';
COMMENT ON TABLE "pig_config"."tenant_info" IS 'tenant_info';

-- ----------------------------
-- Records of tenant_info
-- ----------------------------
BEGIN;
INSERT INTO "pig_config"."tenant_info" ("id", "kp", "tenant_id", "tenant_name", "tenant_desc", "create_source", "gmt_create", "gmt_modified") VALUES (1, '2', 'nacos-default-mcp', 'nacos-default-mcp', 'Nacos default AI MCP module.', 'nacos', 1750214594044, 1750214594044);
COMMIT;

-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS "pig_config"."users";
CREATE TABLE "pig_config"."users" (
  "username" varchar(50) COLLATE "pg_catalog"."default" NOT NULL,
  "password" varchar(500) COLLATE "pg_catalog"."default" NOT NULL,
  "enabled" bool NOT NULL
)
;
ALTER TABLE "pig_config"."users" OWNER TO "postgres";

-- ----------------------------
-- Records of users
-- ----------------------------
BEGIN;
INSERT INTO "pig_config"."users" ("username", "password", "enabled") VALUES ('nacos', '$2a$10$EuWPZHzz32dJN7jexM34MOeYirDdFAZm2kuWj7VEOJhhZkDrxfvUu', 't');
COMMIT;

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "pig_config"."config_info_beta_id_seq"
OWNED BY "pig_config"."config_info_beta"."id";
SELECT setval('"pig_config"."config_info_beta_id_seq"', 1, false);

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "pig_config"."config_info_gray_id_seq"
OWNED BY "pig_config"."config_info_gray"."id";
SELECT setval('"pig_config"."config_info_gray_id_seq"', 1, false);

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "pig_config"."config_info_id_seq"
OWNED BY "pig_config"."config_info"."id";
SELECT setval('"pig_config"."config_info_id_seq"', 1, false);

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "pig_config"."config_info_tag_id_seq"
OWNED BY "pig_config"."config_info_tag"."id";
SELECT setval('"pig_config"."config_info_tag_id_seq"', 1, false);

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "pig_config"."config_tags_relation_id_seq"
OWNED BY "pig_config"."config_tags_relation"."id";
SELECT setval('"pig_config"."config_tags_relation_id_seq"', 1, false);

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "pig_config"."config_tags_relation_nid_seq"
OWNED BY "pig_config"."config_tags_relation"."nid";
SELECT setval('"pig_config"."config_tags_relation_nid_seq"', 1, false);

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "pig_config"."group_capacity_id_seq"
OWNED BY "pig_config"."group_capacity"."id";
SELECT setval('"pig_config"."group_capacity_id_seq"', 1, false);

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "pig_config"."his_config_info_nid_seq"
OWNED BY "pig_config"."his_config_info"."nid";
SELECT setval('"pig_config"."his_config_info_nid_seq"', 1, false);

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "pig_config"."tenant_capacity_id_seq"
OWNED BY "pig_config"."tenant_capacity"."id";
SELECT setval('"pig_config"."tenant_capacity_id_seq"', 1, false);

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "pig_config"."tenant_info_id_seq"
OWNED BY "pig_config"."tenant_info"."id";
SELECT setval('"pig_config"."tenant_info_id_seq"', 1, false);

-- ----------------------------
-- Indexes structure for table config_info
-- ----------------------------
CREATE UNIQUE INDEX "uk_configinfo_datagrouptenant" ON "pig_config"."config_info" USING btree (
  "data_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "group_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table config_info
-- ----------------------------
ALTER TABLE "pig_config"."config_info" ADD CONSTRAINT "config_info_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table config_info_beta
-- ----------------------------
CREATE UNIQUE INDEX "uk_configinfobeta_datagrouptenant" ON "pig_config"."config_info_beta" USING btree (
  "data_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "group_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table config_info_beta
-- ----------------------------
ALTER TABLE "pig_config"."config_info_beta" ADD CONSTRAINT "config_info_beta_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table config_info_gray
-- ----------------------------
ALTER TABLE "pig_config"."config_info_gray" ADD CONSTRAINT "config_info_gray_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table config_info_tag
-- ----------------------------
CREATE UNIQUE INDEX "uk_configinfotag_datagrouptenanttag" ON "pig_config"."config_info_tag" USING btree (
  "data_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "group_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tag_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table config_info_tag
-- ----------------------------
ALTER TABLE "pig_config"."config_info_tag" ADD CONSTRAINT "config_info_tag_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table config_tags_relation
-- ----------------------------
CREATE INDEX "idx_tenant_id" ON "pig_config"."config_tags_relation" USING btree (
  "tenant_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE UNIQUE INDEX "uk_configtagrelation_configidtag" ON "pig_config"."config_tags_relation" USING btree (
  "id" "pg_catalog"."int4_ops" ASC NULLS LAST,
  "tag_name" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tag_type" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table config_tags_relation
-- ----------------------------
ALTER TABLE "pig_config"."config_tags_relation" ADD CONSTRAINT "config_tags_relation_pkey" PRIMARY KEY ("nid");

-- ----------------------------
-- Indexes structure for table group_capacity
-- ----------------------------
CREATE UNIQUE INDEX "uk_group_id" ON "pig_config"."group_capacity" USING btree (
  "group_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table group_capacity
-- ----------------------------
ALTER TABLE "pig_config"."group_capacity" ADD CONSTRAINT "group_capacity_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table his_config_info
-- ----------------------------
CREATE INDEX "idx_did" ON "pig_config"."his_config_info" USING btree (
  "data_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "idx_gmt_create" ON "pig_config"."his_config_info" USING btree (
  "gmt_create" "pg_catalog"."timestamp_ops" ASC NULLS LAST
);
CREATE INDEX "idx_gmt_modified" ON "pig_config"."his_config_info" USING btree (
  "gmt_modified" "pg_catalog"."timestamp_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table his_config_info
-- ----------------------------
ALTER TABLE "pig_config"."his_config_info" ADD CONSTRAINT "his_config_info_pkey" PRIMARY KEY ("nid");

-- ----------------------------
-- Indexes structure for table permissions
-- ----------------------------
CREATE UNIQUE INDEX "uk_role_permission" ON "pig_config"."permissions" USING btree (
  "role" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "resource" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "action" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Indexes structure for table roles
-- ----------------------------
CREATE UNIQUE INDEX "uk_username_role" ON "pig_config"."roles" USING btree (
  "username" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "role" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Indexes structure for table tenant_capacity
-- ----------------------------
CREATE UNIQUE INDEX "uk_tenant_id" ON "pig_config"."tenant_capacity" USING btree (
  "tenant_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table tenant_capacity
-- ----------------------------
ALTER TABLE "pig_config"."tenant_capacity" ADD CONSTRAINT "tenant_capacity_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table tenant_info
-- ----------------------------
CREATE UNIQUE INDEX "uk_tenant_info_kptenantid" ON "pig_config"."tenant_info" USING btree (
  "kp" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "tenant_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
